/*
 * Event.java
 * Team qq 2011
 */
package com.google.code.timetrail.backend;
/**
 * This event will act as a temporary wrapper for an event's text
 * it might eventually do actions, but that's not gonna be implemented now
 * BOUNUS! IT FORMATS THE TEXT #wow #whoa
 * @author Steven
 * @version 1.0
 */
public class Event {

	private String messageText;
	
	private final String dummyEvent = "NO_CURRENT_EVENT";
	/**
	 * Formats the text in Message String to be a beautiful 80 characters per line
	 * @param messageText
	 */
	public Event(String messageText){
		this.messageText = "";
		for(int i = 0; i < messageText.length(); i++){
			if(i != 0 && i % 78 == 0 && messageText.charAt(i) != ' '){
				this.messageText += "-";
			}
			else if(i != 0 && i % 79 == 0){
				this.messageText += "\n";
			}
			else{
				this.messageText += messageText.charAt(i);
			}
		}
	}
	
	public Event(){
		messageText = dummyEvent;
	}
	
	public  String getDummyText(){
		return dummyEvent;
	}
	
	/**
	 * returns the message text for future use
	 * @return the formatted message text
	 */
	public String getMessageText(){
		return messageText;
	}
	
}
